<?php

namespace Game\Logic;

use \Common\Logic\BaseLogic;

class WxUserLogic extends BaseLogic
{
    static $typeDic = array(
        
    );

    private $listModel;

    public function __construct()
    {
        parent::__construct();
        $this->listModel = D('WxUser');
    }

    /**
     * 返回类型字典
     * @return array
     */
    public function getTypeDic()
    {
        return static::$typeDic;
    }

    /**
     * 根据条件统计
     * @param array $where
     * @return mixed
     */
    public function statistics($where = array())
    {
        return $this->listModel->where($where)->count();
    }

    /**
     * 获取任务列表
     * @param int $page
     * @param int $size
     * @param $where
     * @return mixed
     */
    public function getList($page = 1, $size = 20, $where)
    {
        $list = $this->listModel->where($where)->page($page, $size)->order("time desc")->select();
        $total = $this->statistics($where);
        return static::$res->suc("成功", array(
            "list" => $list,
            "total" => $total
        ));
    }

}
